<style>
.content-group {background:#fff;border-radius: 0.5rem;margin-bottom:0.39rem}
.label-info {
	background-color:#d9f9ee;
	color:#03c274;
	padding: .2em .4em .2em;
}
.fui-list:before {
    border-top: 0 solid #D9D9D9;
}
.msg-input {
	position: relative;
}

.msg-input input {
	width: 100%;
	height: 1.65rem;
	display: block;
	border: none;
	border-radius: 1rem;
	font-family: inherit;
	color: #3d4145;
	font-size: 0.65rem;
	font-weight: normal;
	padding: 0 0.5rem;
	background-color: #f2f2f2;
}

.msg-input input::-webkit-input-placeholder {
	color: #cccccc;
	opacity: 1;
}

.msg-input i {
	position: absolute;
	font-size: 0.8rem;
	color: #b4b4b4;
	top: 0;
	right: 0.4rem;
	line-height: 1.6rem;
}

.msg-input i + input {
	padding-left: 1.4rem;
}
.page-goods-detail .seckill-container  .seckill-list2 .fui-list-inner .text.timer span {
    display: inline-block;
    background:#fb2b3b;
    color:#fff;
    width:.9rem;height:.9rem;
    border-radius: .1rem;
    line-height:.9rem;
    font-size:.5rem; 
	text-align: center;
}
.video-sms-pane {
	top:10rem;
	right:0;
}
.arrow-left {
  display:inline-block;
  width:0px;
  height:0px;
  border-bottom:5px solid transparent;  /* left arrow slant */
  border-top:5px solid transparent; /* right arrow slant */
  border-right:5px solid #ff4e2c; /* bottom, add background color here */
  font-size:0px;
  line-height:0px;
  margin-bottom:-1px
}
</style>
<div ng-include="sys_html('common/_header','','','jy_weishop')"></div>
<div class="fui-page fui-page-current page-goods-detail">
	<div class="topbg" style="width:100%;height:6.8rem;background: url('../addons/jy_quanhuo/resource/images/topbg.png') no-repeat 50%;background-size: cover;background-color:#63BE72;">
			<div class="fui-cellone">
				<div class="fui-cellone-label" style="width:auto;">
					<img style="border-radius: 0.2rem;width:2.5rem;height:2.5rem" ng-src="{{tomedia(pagedata.pluginset.logo) || '../addons/jy_quanhuo/resource/images/logo.png'}}" />
				</div>
				<div class="fui-cellone-text" style="font-size:0.7rem;color:#fff;padding-left:0.5rem">
					<div class="bold">{{pagedata.pluginset.title || '活动助手'}}模板库 </div>
					<div style="font-size:0.6rem">{{pagedata.item.num || 0}}个活动 | {{pagedata.item.num || 0}}人关注</div>
					<div class="fui-tag fui-tag-danger" style="background:linear-gradient(to right,rgba(244,221,187,0.6),rgba(235,216,174,1));color:#512f0a;width:auto;font-weight:400">官方模板库</div>
				</div>
			</div>
	</div>
	<div class="fui-content" style="background:none;top:0;">
		<div style="padding:0.5rem;margin-top:-2.8rem">
			<div class="pic">
				<img class="radiustop" src="{{tomedia(pagedata.item.logo) || '../core/resource/images/nopic.jpg'}}" style="display: block; width: 100%; height: 12rem;">
			</div>
			<!--拼团-->
			<div class="seckill-container">
				<div class="fui-list seckill-list" style="background: #fb2f30;padding:0.5rem">
					<div class="fui-list-media">
						<div class="fui-tag fui-tag-danger bold" style="padding:0.3rem 0.4rem;background:#d23114">
								<div>限时</div>
								<div style="padding-top:0.3rem">{{pagedata.item.unitname}}</div>
						</div>
					</div>
					<div class="fui-list-inner" style="color:#fff;">
						￥<span class="bigprice bold" style="font-size:1.5rem">{{pagedata.item.price>0?pagedata.item.price:168}}</span>
					</div>
				</div>
				<div class="fui-list seckill-list2" style="background:#ffeeda;width:6rem;">
					<div class="fui-list-inner">
						<div class="text">距结束还剩:</div>
						<div class="text timer" style="height:auto;font-size:0.5rem" ng-init="tool.time_down(pagedata.item.rest_time)">
							<span class="time-day" style="width:.9rem;padding-right:0.1rem">{{pagedata.item.rest_time.day}}</span> 天
							<span class="time-hour">{{pagedata.item.rest_time.hour}}</span> :
							<span class="time-min">{{pagedata.item.rest_time.minute}}</span> :
							<span class="time-sec">{{pagedata.item.rest_time.second}}</span>
						</div>
					</div>
				</div>
			</div>
			<div class="fui-cell-group radiusbottom" style="margin-top:0;padding-bottom:8px">
				<div class="fui-cell" style='padding-bottom:0.2rem'>
					<div class="fui-cell-info">
						<div class="name bold" style="font-size:0.8rem">
								{{pagedata.item.title}}
						</div>
						<div class="subtitle">
								<span class="label label-info">到店自提</span>
						</div>
						<div class="subtitle" style="font-size:0.6rem;margin-top:0.3rem">
								<i class="icon icon-hot red" style="color:#fb2f30"></i> 浏览 5688 | 分享188 | 订单168
						</div>
					</div>
				</div>
			</div>
			<!--活动描述-->
			<div class="fui-cell-group radius">
				<div class="fui-cell">
					<div class="fui-cell-text bold">活动描述</div>
				</div>
				<div class="fui-cell" style="padding-top:0;">
					<div class="content-block content-images" ng-bind-html="trust(pagedata.item.content)"></div>
				</div>
			</div>
			<!--活动商品-->
			<div class="fui-cell-group radius">
				<div class="fui-cell">
					<div class="fui-cell-text bold">{{pagedata.item.unitname}}商品</div>
				</div>
				<div ng-repeat="g in pagedata.item.goods" class='fui-list align-start' style="padding-top:0.5rem;border-top: 1px solid #ebebeb;">
					<div class='fui-list-media'>
					   <img style="width: 5rem;height: 5rem;" src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}" />
					</div>
					<div class='fui-list-inner'>
						<div class='text bold'>{{g.title}}</div>
						<div class="fui-cellone" style="padding:0.5rem 0;">
							<div class='fui-cellone-label' style="width:auto">
							   <div class="bigprice red bold" style="font-size:1rem;position:relative">
								￥{{g.price}}
								</div>
							</div>
							<div class='fui-cellone-info' style="padding-left:0.2rem">
								<span class="arrow-left"></span><span style="display:inline-block;padding:0.1rem 0.3rem;color:#fff;font-size:0.5rem;background:#ff4e2c;border-radius:0.1rem;">秒杀价</span>
							</div>
							<div class='fui-cellone-remark noremark'>
								<span style="font-size:0.6rem;color:#666">库存500</span>
							</div>
						</div>
						<div class="fui-cellone" style="padding:0;">
							<div class='fui-cellone-info'>
							<span class="progress" style="float: left;margin-top:0.35rem;margin-bottom:0.25rem;width: 4.5rem;height: 0.5rem;border-radius: .5rem;overflow: hidden;">
								<div class="progress-bar" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: {{g.percent || 1}}%;background-color:red;"><span class="sr-only">60% Complete</span></div>
							</span>
							<span class="process-text" style="float: left;font-size:0.55rem;margin:0.3rem;">已秒 0%</span>
							</div>
						</div>
						<div class="fui-cellone" style="padding:0;">
							<div class='fui-cellone-info'>
								<span class="label label-info">限购</span> <span style="font-size:0.6rem;color:#666">每人最多买1件</span>
							</div>
							<div class='fui-cellone-remark noremark'>
								<span class="btn btn-sm btn-gray" style="color:#fff">已结束</span>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!--成交记录-->
			<div class="fui-cell-group radius">
				<div class="fui-cell">
					<div class="fui-cell-text bold">成交记录<span style="font-size:0.6rem;color:#666">（{{pagedata.lognum || 0}}）</span></div>
				</div>
				<div ng-repeat="m in pagedata.logs" class="fui-cell" style="border-top: 1px solid #ebebeb;">
					<div class="fui-cell-label bold" style="width:auto">{{pagedata.lognum-$index}}.</div>
					<div class="fui-cell-text">
						<div class="fui-cellone" style="padding:0;">
							<div class='fui-cellone-label' style="width:auto;margin-right:0.3rem">
								<img style="width: 1.6rem;height: 1.6rem;border-radius:50%;" src="{{tomedia(m.member.avatar) || '../core/resource/images/nopic.jpg'}}" />
							</div>
							<div class='fui-cellone-text'>
								<div class="text bold" style="font-size:0.65rem">{{m.member.nickname || '昵称'}} <div class="gray" style="font-size:0.55rem">{{m.days || '1天前'}}</div></div>
								<div class="gray" style="font-size:0.55rem">{{pagedata.item.goods[0].title || '商品名称'}}</div>
							</div>
						</div>
					</div>
					<div class='fui-cellone-remark noremark'>
						<div class="c" style="font-size:0.65rem;width:1.4rem;background:#ffe5f0;color:#d06764;padding:0.2rem;border-radius:50%;border: 1px solid #d06764;">+1</div>
					</div>
				</div>
			</div>
			<!--评论-->
			<div class="fui-cell-group radius">
				<div class="fui-cell">
					<div class="fui-cell-label bold" style="width:auto;color:#333;margin-right:0.3rem;font-size:0.75rem">评论 <span style="color:#666;margin-left:0.2rem">|</span></div>
					<div class="fui-cell-info">
						<div class="msg-input">
							<input type="search" placeholder="已有{{pagedata.msgnum || 16}}条留言，快来说说您的感想吧！" class="search" ng-model="pagedata.params.keyword" style="text-align: left; background:#f9f9f9" />
							<i id="searchsub" class="icon icon-bianji"  ng-click="tool.get_list('jy_quan/index/getlist/',true)"></i>
						</div>
					</div>
				</div>
				<div ng-repeat="m in pagedata.list" class="fui-cell" style="border-top: 1px solid #ebebeb;">
					<div class='fui-cellone-label' style="width:auto;margin-right:0.3rem">
						<img style="width: 2rem;height:2rem;border-radius:50%;" src="{{tomedia(m.member.avatar) || '../core/resource/images/nopic.jpg'}}" />
					</div>
					<div class='fui-cellone-text'>
						<div class="text bold" style="font-size:0.65rem;color:#5c5c5c">{{m.member.nickname || '昵称'}}</div>
						<div class="text" style="font-size:0.65rem">{{m.desc || '留言内容'}}</div>
						<div class="gray" style="font-size:0.55rem">{{m.days || '1天前'}}</div>
					</div>
				</div>
			</div>
			<div ng-include="sys_html('common/_copyright',true)"></div>
		</div>
		<div class="fui-navbar-tip" style="color:#fff;bottom:3rem;background:none;">
			<div class="bold" style="font-size:0.55rem;line-height:1.4rem;margin:auto;width:5rem; background-color:rgba(0,0,0,0.5);border-radius:1rem;">去参与<i class="icon icon-moreunfold" style="font-size:0.55rem;"></i></div>
		</div>
		 <div class="fui-navbar" style="background:none;height:2.4rem">
			<div style="padding:0.2rem 0.5rem">
				<div class="nav-item btn btn-success" href="javascript:" ng-click="pagedata.check_up()" style="border-radius:1rem;height:2rem">使用该模板</div>
			</div>
		  </div>
	</div>
</div>
<div ng-include="sys_html('common/_share','','','jy_weishop')"></div>
<div ng-include="sys_html('common/_gotop',true)"></div>
<!--弹目-->
<div ng-if="pagedata.showtanmus" class="video-sms-pane {{pagedata.transition?'transition':''}}">
		<div class="video-sms-text">
			<image class="video-sms-logo" ng-src="{{pagedata.tanmus[pagedata.nowmsgid].avatar}}"/>
			<span class="overflow-h"> {{pagedata.tanmus[pagedata.nowmsgid].nickname}} 进入了活动</span>
		</div>
</div>
<script>
scope.pagedata.check_up=function(){
	var pid=scope.pagedata.item.id
	scope.get('jy_quanhuo/tpl_look/check_up/pid='+pid,function(res){});
}
scope.pagedata.getlog=function(){
	scope.get('jy_quanhuo/tpl_look/getlog/',function(res){
		scope.pagedata.logs=res.list;
		scope.$evalAsync();
	});
}
scope.pagedata.getlog();
scope.tool.get_list('jy_quanhuo/tpl_look/getmsg/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_quanhuo/tpl_look/getmsg/');
}
scope.pagedata.gettanmus=function() {
	if(!scope.pagedata.issocketmsg){
			scope.pagedata.nowmsgid=0;
			scope.get('jy_quanhuo/get_data/gettanmus/page='+scope.pagedata.tanmuspage,function(res){
						//console.log(res);
						scope.pagedata.tanmus=res.list
						if(scope.pagedata.tanmus.length>0){
							scope.pagedata.tanmuspage++;
							scope.pagedata.up_oldtanmu();
						}
			});
	}
}
setTimeout(function(){
	scope.pagedata.gettanmus();
},2000);
scope.pagedata.up_oldtanmu=function() {
		if(scope.page.action=='index'){
			var i=scope.pagedata.nowmsgid;
			if(i<scope.pagedata.tanmus.length){
				set_tanmu(scope.pagedata.tanmus[i].nickname,scope.pagedata.tanmus[i].avatar,scope.pagedata.tanmus[i].time);
			}else{
				scope.pagedata.gettanmus();
			}
		}else{
			return false;
		}
}
function set_tanmu(nickname,avatar,time) {
		scope.pagedata.nowmsgid++
		scope.pagedata.showtanmus=true
		scope.$evalAsync(scope.pagedata.showtanmus);
		setTimeout(function(){
			scope.pagedata.transition=true
			scope.$evalAsync(scope.pagedata.transition);	
		},300);
		setTimeout(function(){
			scope.pagedata.showtanmus=false
			scope.pagedata.transition=false
			scope.$evalAsync(scope.pagedata.showtanmus);	
		},2000);
		setTimeout(function(){
			//等待5秒，如果没有新的订单消息，就弹储备订单消息
			scope.pagedata.issocketmsg=scope.pagedata.issocketmsg?scope.pagedata.issocketmsg:false;
			if(!scope.pagedata.issocketmsg && scope.page.action=='index'){
				scope.pagedata.up_oldtanmu();
			}
		},4000);
}
</script>